package pkg

import (
	"encoding/json"
	"fmt"
	"github.com/Baidu-AIP/golang-sdk/aip/censor"
)

type Baiduu struct {
	ConclusionType uint64 `json:"conclusionType"`
}

func Check(message string) bool {
	client := censor.NewClient("8SqvFDa4cAdboYqITL6D8KR4", "VKOsWNcaiJx9RbbZnnQJHDpKleQPuUzD")
	//如果是百度云ak sk,使用下面的客户端

	//图片文件，

	res := client.TextCensor(message)
	fmt.Println(res)
	//图片url
	var ress Baiduu
	json.Unmarshal([]byte(res), &ress)
	if ress.ConclusionType == 1 {
		return true
	}
	return false

}
